<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr">
<head>
#headTag('编辑个人资料')
<script type="text/javascript">
KE.show({
	id : 'intro',
	urlType:'domain',
	items: ['textcolor', 'bgcolor', 'bold',
'italic', 'strikethrough', 'removeformat'],
	width:'400px',
	height:'200px',
	resizeMode:0
});
</script>
<script type="text/javascript">
$(document).ready(function(){
    $.datepicker.regional['zh-CN'] =
    {
       clearText: '清除', clearStatus: '清除已选日期',
       closeText: '关闭', closeStatus: '不改变当前选择',
       prevText: '&lt;上月', prevStatus: '显示上月',
       nextText: '下月&gt;', nextStatus: '显示下月',
       currentText: '今天', currentStatus: '显示本月',
       monthNames: ['一月','二月','三月','四月','五月','六月',
       '七月','八月','九月','十月','十一月','十二月'],
       monthNamesShort: ['一','二','三','四','五','六',
       '七','八','九','十','十一','十二'],
       monthStatus: '选择月份', yearStatus: '选择年份',
       weekHeader: '周', weekStatus: '年内周次',
       dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
       dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
       dayNamesMin: ['日','一','二','三','四','五','六'],
       dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD',
       dateFormat: 'yy-mm-dd', firstDay: 1,
       initStatus: '请选择日期', isRTL: false
  };
    $.datepicker.setDefaults($.datepicker.regional['zh-CN']);	
	$("input[name=birthday]").datepicker({maxDate: new Date(), defaultDate:'-19y', changeYear:true, changeMonth:true});
});
</script>
<script type="text/javascript">
function loadProvince(){
	$.get(forum.baseURL + '/region',{}, function(json){
		for(items in json.returnObject){
			$('select[name=province] option:last').after('<option value="' + items + '">' + json.returnObject[items] + '</option>');
		}
		$('select[name=province]').show();
	},'json');
	$('select[name=province]').change(function(){
		var prov = $('select[name=province]').val();
		//空选项
		if(prov == 0){
			$('select[name=city]').hide();
		} else {
			loadCity(prov);
		}
	});
}
function loadCity(prov){
	$('select[name=city]').hide();
	$('select[name=city]').html('');
	$.get(forum.baseURL + '/region/province/' + prov,{}, function(json){
		var i = 0;
		for (items in json.returnObject){
			$('select[name=city]').append('<option value="' + items + '">' + json.returnObject[items] + '</option>');
			++ i;
		}
		if(i > 1){
			$('select[name=city]').show();
		}
	},'json');
}
function loadResidence(){
	$.get(forum.baseURL + '/region/residence',{}, function(json){
		for (items in json.returnObject){
			$('select[name=residence] option:last').after('<option value="' + items + '">' + json.returnObject[items] + '</option>');
		}
		$('select[name=residence]').show();
	},'json');
}
</script>
</head>
<body>
<div id="page">
#parse("default/_header.htm")
<div id="middle">
<div id="main_wrap">
	<div id="main">
		#topbar()
		<div class="center">
			<h1>个人资料</h1>
			<div class="content">
				<table cellpadding="0" cellspacing="0" class="modify_profile">
					<tr>
						<th class="th">个人签名</th>
						<td class="td">
							<input name="sign" size="2000px" type="text" value="$!{owner.extInfo.signature}"/>
							<span class="error"></span>
						</td>
					</tr>
					<tr>
						<th class="th">自我介绍</th>
						<td class="td"><textarea name="intro" id="intro">$!{owner.extInfo.intro}</textarea><span class="error"></span></td>
					</tr>
					<tr>
						<th class="th">性别</th>
						<td class="td">
							<select name="sex">
								<option value="1" #if($owner.sex == 1)selected="selected"#end>男</option>
								<option value="2" #if($owner.sex == 2)selected="selected"#end>女</option>
							</select>
							<span class="error"></span>
						</td>
					</tr>
					<tr>
						<th class="th">所在工厂</th>
						<td class="td"><input type="text" name="factory" value="$!{owner.extInfo.factory}"/><span class="error"></span></td>
					</tr>
					<tr>
						<th class="th">生日</th>
						<td class="td"><input type="text" name="birthday" value="$utils.dateFormat('yyyy-MM-dd',$owner.extInfo.birthday)"/><span class="error"></span></td>
					</tr>
					<tr>
						<td>目前居住地</td>
						<td height="20px">
							#if($owner.extInfo.residence)
							<span class="residence">$owner.extInfo.residence</span> <a class="residence" href="javascript:$('.residence').hide();loadResidence();">修改</a>
							#end
							<select name="residence" style="display:none;width:80px;">
								<option value="0">...</option>
							</select>
							#if(!$owner.extInfo.residence)
								<script type="text/javascript">
								loadResidence();
								</script>
							#end
						</td>
					</tr>
					<tr>
						<th class="th">来自</th>
						<td height="20px" class="td">
							#if($owner.extInfo.from)
							<span class="from">$owner.extInfo.from</span> <a class="from" href="javascript:$('.from').hide();loadProvince();">修改</a>
							#end
							<select name="province" style="display:none;width:80px;">
								<option value="0">...</option>
							</select>
							<select name="city" style="display:none;width:100px;">
							</select>
							<span class="error"></span>
							#if(!$owner.extInfo.from)
							<script type="text/javascript">
							loadProvince();
							</script>
							#end
						</td>
					</tr>
					<tr>
						<th class="th">QQ</th>
						<td class="td"><input type="text" name="QQ" value="$!{owner.extInfo.qq}"/><span class="error"></span></td>
					</tr>
					<tr>
						<th class="th"></th>
						<td class="td"><input type="submit" onclick="forum.op.updateAccountInfo(${owner.id})" class="submit" value="提交"/></td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
#parse("default/center/_sidebar.htm")
</div>
</div>
#parse("default/_footer.htm")
</body>
</html>